@layout("/common/_container.html"){
<div class="row">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>管理</h5>
            </div>
            <div class="ibox-content">
                <div class="row row-lg">
                    <div class="col-sm-12">
                        <div class="row">
                            <input type="hidden" id="orgId" value="${orgId}">
                            <input type="hidden" id="currentSchoolYear" value="${currentSchoolYear}">
                            <input type="hidden" id="phase_gradeMap" value='${phase_gradeMap}'>
                            <div class="row">
                                <div class="col-lg-10 col-sm-9">
                                    <div class="row">
                                        <div class="col-lg-3 col-sm-8" style="width: 15%">
                                            <#SelectCon id="schoolYear" name="学年" underline="true" >
                                            @for(schoolYear in schoolYearList){
                                            <option value="${schoolYear}">${schoolYear}</option>
                                            @}
                                        </#SelectCon>
                                    </div>
                                    <div class="col-lg-3 col-sm-8" style="width: 15%">
                                        <#SelectCon id="phaseId" name="学段" underline="true" onchange="showGradeList(this);">
                                        <option value="">请选择</option>
                                        @for(phaseMeta in phaseList){
                                        <option value="${phaseMeta.id}">${phaseMeta.name}</option>
                                        @}
                                    </#SelectCon>
                                </div>
                                <div class="col-lg-3 col-sm-8" style="width: 15%">
                                    <#SelectCon id="gradeId" name="年级" underline="true" >
                                    <option value="">请选择</option>
                                </#SelectCon>
                            </div>
                                        <div class="col-lg-3 col-sm-8" style="width: 16%">
                                            <#NameCon id="stuName" name="学生姓名" />
                                        </div>
                                    <div class="col-lg-3 col-sm-8" style="width: 16%">
                                        <#NameCon id="name" name="班级名称" />
                                    </div>

                            </div>
                        </div>
                        <div class="col-lg-2 col-sm-3" style="width: 13%">
                            <div class="row">
                                <div class="col-lg-12 col-sm-12" >
                                    <#button name="搜索" icon="fa-search" clickFun="PtClass.search()"/>
                                </div>
                            </div>
                        </div>
                    </div>

                        <div class="hidden-xs" id="PtClassTableToolbar" role="group">
                            @if(shiro.hasPermission("/ptClass/add")){
                                <#button name="添加" icon="fa-plus" clickFun="PtClass.openAddPtClass()"/>
                            @}
                            @if(shiro.hasPermission("/ptClass/editTeacher")){
                            <#button name="任课教师设置" icon="fa-street-view" clickFun="PtClass.editTeacher()" space="false"/>
                            @}
                            @if(shiro.hasPermission("/ptClass/editStudent")){
                            <#button name="管理学生" icon="fa-users" clickFun="PtClass.editStudent()" space="false"/>
                            @}
                            @if(shiro.hasPermission("/ptClass/batchImportClass")){
                            <#button name="导入班级" icon="fa-folder-open" clickFun="PtClass.batchImportClass()" space="false"/>
                            @}
                            @if(shiro.hasPermission("/ptClass/batchImportTeacher")){
                            <#button name="批量设置任课教师" icon="fa-folder-open-o" clickFun="PtClass.batchImportTeacher()" space="false"/>
                            @}
                            @if(shiro.hasPermission("/ptClass/batchImportStudent")){
                            <#button name="批量管理学生" icon="fa-folder" clickFun="PtClass.batchImportStudent()" space="false"/>
                            @}
                            @if(shiro.hasPermission("/ptClass/classUpdate")){
                            <#button name="班级升班" icon="fa-paper-plane" clickFun="PtClass.classUpdate()" space="false"/>
                            @}
                            @if(shiro.hasPermission("/ptClass/classEnd")){
                            <#button name="班级毕业" icon="fa-graduation-cap" clickFun="PtClass.classEnd()" space="false"/>
                            @}
                        </div>
                        <#table id="PtClassTable"/>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctxPath}/static/modular/system/ptClass/ptClass.js"></script>
<script>
    //显示年级
    function showGradeList(obj){
        if($("#phase_gradeMap").val()!==''){
            var map = JSON.parse(($("#phase_gradeMap").val()));
            var gradeList = map[$(obj).val()];
            var optionHtmlStr = "<option value=''>请选择...</option>";
            if(gradeList!=null){
                $.each(gradeList,function(n,grade){
                    optionHtmlStr += "<option value='"+grade.id+"' ";
                    optionHtmlStr += ">"+grade.name+"</option>";
                });
            }
            $("#gradeId").html(optionHtmlStr);
        }
    }
</script>
@}
